<?php
include 'util.php';

$apikey = "0d5cbb6f-218d-4f91-b32c-1f51607bb4bd";
$secret = "my-secret";

error_log ("Received callback action in CallAndRecordCallback: " . $_REQUEST['action']);

// If the tone is 1, hangs up
if ($_REQUEST['action'] == "PlayEnd" AND $_REQUEST['tone'] == "1") {
    $result = invokeApi ("Hangup", $apikey, $secret, "callId=".$_REQUEST['callId']);
}
?>
